/**
 * 报表设计公司(2011)
 */
package com.reportgear.report.core.background;

import java.awt.Image;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

/**
 * @version 1.0 2011-3-24
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since ANNCSR 2.0
 */
public class ImageSerializable implements Serializable {

	private transient Image image;

	public ImageSerializable(Image paramImage) {
		this.image = paramImage;
	}

	public Image getImage() {
		return this.image;
	}

	private void readObject(ObjectInputStream paramObjectInputStream) throws ClassNotFoundException, IOException {
		paramObjectInputStream.defaultReadObject();
		byte[] arrayOfByte = (byte[]) paramObjectInputStream.readObject();
		if (arrayOfByte == null) {
			return;
		}
		int i = paramObjectInputStream.readInt();
		int j = paramObjectInputStream.readInt();
		if ((i <= 0) || (j <= 0)) {
			return;
		}
		// this.image = ObjectXML.decodeImage(i, j, arrayOfByte);
	}

	private void writeObject(ObjectOutputStream paramObjectOutputStream) throws IOException {
		// paramObjectOutputStream.defaultWriteObject();
		// Object localObject = (this.image != null) ?
		// ObjectXML.encodeImage(this.image) : null;
		// paramObjectOutputStream.writeObject(localObject);
		// if (localObject == null) {
		// return;
		// }
		// paramObjectOutputStream.writeInt(this.image.getWidth(null));
		// paramObjectOutputStream.writeInt(this.image.getHeight(null));
	}
}